const Sequelize = require('sequelize');
module.exports = function(sequelize, DataTypes) {
  return sequelize.define('apartment_pie', {
    id: {
      type: DataTypes.STRING(40),
      allowNull: false,
      primaryKey: true
    },
    jkyd: {
      type: DataTypes.BIGINT,
      allowNull: true,
      comment: "监控用电"
    },
    ktyd: {
      type: DataTypes.BIGINT,
      allowNull: true,
      comment: "空调用电"
    },
    gqzm: {
      type: DataTypes.BIGINT,
      allowNull: true,
      comment: "公区照明"
    },
    dtgd: {
      type: DataTypes.BIGINT,
      allowNull: true,
      comment: "电梯供电"
    },
    jtzm: {
      type: DataTypes.BIGINT,
      allowNull: true,
      comment: "家庭照明"
    },
    jdyd: {
      type: DataTypes.BIGINT,
      allowNull: true,
      comment: "家电用电"
    },
    gsyd: {
      type: DataTypes.BIGINT,
      allowNull: true,
      comment: "供水用电"
    },
    gqsh: {
      type: DataTypes.BIGINT,
      allowNull: true,
      comment: "公区水耗"
    },
    jtsh: {
      type: DataTypes.BIGINT,
      allowNull: true,
      comment: "家庭水耗"
    },
    yys: {
      type: DataTypes.BIGINT,
      allowNull: true,
      comment: "饮用水供应"
    },
    jtyq: {
      type: DataTypes.BIGINT,
      allowNull: true,
      comment: "家庭用气"
    },
    lsryq: {
      type: DataTypes.BIGINT,
      allowNull: true,
      comment: "冷热源用气"
    },
    apartment: {
      type: DataTypes.STRING(255),
      allowNull: true,
      comment: "小区名字"
    },
    electricityTB: {
      type: DataTypes.BIGINT,
      allowNull: true,
      comment: "同比"
    },
    electricityHB: {
      type: DataTypes.BIGINT,
      allowNull: true,
      comment: "环比"
    },
    floor: {
      type: DataTypes.STRING(255),
      allowNull: true,
      comment: "楼栋"
    },
    electricity: {
      type: DataTypes.BIGINT,
      allowNull: true
    },
    water: {
      type: DataTypes.BIGINT,
      allowNull: true
    },
    gas: {
      type: DataTypes.BIGINT,
      allowNull: true
    },
    waterTB: {
      type: DataTypes.STRING(255),
      allowNull: true
    },
    waterHB: {
      type: DataTypes.STRING(255),
      allowNull: true
    },
    gasTB: {
      type: DataTypes.STRING(255),
      allowNull: true
    },
    gasHB: {
      type: DataTypes.STRING(255),
      allowNull: true
    }
  }, {
    sequelize,
    tableName: 'apartment_pie',
    timestamps: false,
    indexes: [
      {
        name: "PRIMARY",
        unique: true,
        using: "BTREE",
        fields: [
          { name: "id" },
        ]
      },
    ]
  });
};
